package service.serviceImpl;

import dao.LoginMapper;
import dao.daoImpl.LoginMapperImpl;
import pojo.Function;
import pojo.Log;
import pojo.User;
import service.LoginService;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by Administrator on 2017-11-20.
 */
public class LoginServiceImpl implements LoginService {
    LoginMapper loginMapper=null;
    public User checkLogin(String username, String password) throws SQLException {
        loginMapper=new LoginMapperImpl();
        return loginMapper.selectUserByNamePwd(username,password);
    }

    @Override
    public List<Function> getFunction(int roleId,String functionDoc) throws SQLException {
        loginMapper=new LoginMapperImpl();
        return loginMapper.getFunction(roleId,functionDoc);
    }

    @Override
    public List<Function> getFunctionDoc() throws SQLException {
        loginMapper=new LoginMapperImpl();

        return loginMapper.getFunctionDoc();
    }

    @Override
    public Function checkUrl(int roleId, String urls) throws SQLException {
        loginMapper=new LoginMapperImpl();
        return loginMapper.checkUrl(roleId,urls);
    }


}
